import { Member } from "@/types/member";
import request from "@/utils/request";

export function addMember(member: Member) {
    return request({
        method: 'post',
        url: '/family/save',
        data: {
            name: member.name,
            member: member.member
        }
    })
}

export function modifyMember(member: Member) {
    return request({
        method: 'put',
        url: '/family/update',
        data: member
    })
}

export function deleteMembers(ids: number[]) {
    return request.delete('/family/delete', { params: { ids: ids.toString() } })
}

export function getAllMembers() {
    return request({
        method: 'get',
        url: '/family/select'
    })
}